"""
!/usr/bin/env python
-*- coding: utf-8 -*-
@Author  : MarkJia
@Site    : 
@File    : 20、fixture的参数化.py
"""

import pytest


# 一：数据驱动
@pytest.mark.parametrize("name", ["双杰", "eap", "云平台", "9连屏看板"])
def test_demo1(name):
    print(name)

# 二：使用 fixture 实现参数化
# 使用 fixture 的 params 参数实现

@pytest.fixture(params=["ht", "selenium", "requests", "appium"])
#  =====================   request 是 fixture 内置参数传递 ============================
def login(request):
    yield request.param


"""
20、fixture的参数化.py::test_case2[ht] PASSED                            [ 25%]数据为:ht

20、fixture的参数化.py::test_case2[selenium] PASSED                      [ 50%]数据为:selenium

20、fixture的参数化.py::test_case2[requests] PASSED                      [ 75%]数据为:requests

20、fixture的参数化.py::test_case2[appium] PASSED                        [100%]数据为:appium

"""


def test_case2(login):
    print(f'数据为:{login}')
